<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::group(['namespace'=>'TeacherApi\User'],function(){
	Route::get('/is_login', 'LoginController@is_login');
	Route::post('/user/login','LoginController@login');//登入处理
	Route::post('/user/edit','UserController@edit_user_info');//修改用户信息
	Route::post('/user/avatar','UserController@avatar_upload');//修改用户信息
	Route::post('/user/get','UserController@get_user');//获取用户信息 根据id
	Route::post('/user/password','LoginController@edit_password');//修改密码
	Route::post('/user/get_sign','UserController@get_sign');//获取打卡
	Route::post('/user/add_sign','UserController@add_sign');//增加打卡
	Route::post('/user/save_questions','UserController@save_questions');//保存每日题目
});
Route::group(['namespace'=>'TeacherApi\Question'],function(){
	Route::post('/getQuestions','QuestionListController@getQuestions');//获取题目
});

Route::group(['namespace'=>'TeacherApi\GradeSubject'],function(){
	Route::post('/get_grade_subject','GradeSubjectController@get_grade_subject');//年级科目
	Route::post('/get_default_subject','GradeSubjectController@get_default_subject');//设置默认年级科目
	Route::post('/setting_default_subject','GradeSubjectController@setting_default_subject');//获取默认年级科目
});